package restaurant.gui;

public class Node {
	public int name;
	public Node node1;
	public Node node2;
	public Node node3;
	public Node node4;

	public Node() {
		this.name = -1;
		this.node1 = null;
		this.node2 = null;
		this.node3 = null;
		this.node4 = null;
	}
	
	public Node(int name) {
		this.name = name;
		this.node1 = null;
		this.node2 = null;
		this.node3 = null;
		this.node4 = null;
	}
	
	public boolean isLeaf() {
		return this.node1 == null && this.node2 == null && this.node3 == null && this.node4 == null;
	}
	
	@Override
	public String toString() {
		String tmp = String.valueOf(this.name) + "\n";
		if(this.node1 != null)
			tmp += this.node1 + "\t";
		if(this.node2 != null)
			tmp += this.node2 + "\t";
		if(this.node3 != null)
			tmp += this.node3 + "\t";
		if(this.node4 != null)
			tmp += this.node4 + "\n";
		return tmp;
	}
}